package com.nuanshui.heatedloan.userinfo.dal.mapper;

import com.nuanshui.heatedloan.userinfo.model.UserFansRelation;
import com.nuanshui.heatedloan.userinfo.vo.UserVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;

import java.util.List;


public interface UserFansRelationMapper {

	Long countInterestedByUserId(@Param("userId")String userId);
	
	Long countFansByUserId(@Param("userId")String userId);
	
	List<UserFansRelation> loadFansByUserId(@Param("userId")String userId);
	
	List<String> loadFansIdsByUserId(@Param("userId")String userId);
	List<UserFansRelation> loadUserFollowers(@Param("userId")String userId);
	
	void insert(@Param("sourceUserId")String sourceUserId, @Param("targetUserId")String targetUserId);
	
	void delete(@Param("sourceUserId")String sourceUserId, @Param("targetUserId")String targetUserId);
	
	Integer isFans(@Param("sourceUserId")String sourceUserId, @Param("targetUserId")String targetUserId);
	
	/**
	 *获取用户的关注用户
	 * @param 
	 * @author guohao
	 * @date 2015年4月22日 上午9:50:57
	 */
    List<UserVo> findInterestedUser(@Param("userId") String userId, @Param("currentUserId") String currentUserId, @Param("pager") Pageable pageable);
	
	List<UserVo> findUserFans(@Param("userId") String userId, @Param("currentUserId") String currentUserId, @Param("pager") Pageable pageable);
	/**
	 *获取用户的所有关注用户
	 * @param 
	 * @author guohao
	 * @date 2015年4月22日 上午9:50:57
	 */
    List<UserVo> findAllInterestedUser(@Param("userId") String userId, @Param("currentUserId") String currentUserId, @Param("pager") Pageable pageable);
	
	
	List<UserVo> findAllUserFans(@Param("userId") String userId, @Param("currentUserId") String loginedId);
}
